<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script type="module">
	// import Promise from "./index.js";
	// 异常穿透:如果你有一个失败的Promise实例，要执行下一个then函数的失败回调，如果失败回调未声明，那么会忽略。
	new Promise(function (resolve, reject) {
		resolve(1);
	}).then(value => {
		console.log(value);// 1
		throw value + 1;// 2
	}).then(value => {
		console.log(value);// 2
		return value + 1;
	}).then(value => {
		console.log(value);// 3
		return value + 1;
	}).then(value => {
		console.log(value);// 4
		return value + 1;
	}, reason => {
		console.log(reason);// 2
	});

</script>
</html>